<template>
	<view class="bigbox">
		<view class="reset">
			重置密码
		</view>
		<view class="passwordsbox">
			<input type="text" value="" placeholder="请输入密码" password="" @input="countInput" />
		</view>
		<view class="truebtn" @click="truebtn">
			确认
		</view>



		<!-- 弹框 -->
		<view class="popup" v-if="loadModal">
			<view class="">
				<image src="https://fangguaner.wm76.mtnet.ren/static/applet/tu1.png" mode="aspectFit"></image>
			</view>
			<view class="gray-text">手机号码不能为空</view>
		</view>

	</view>
	</view>
</template>

<script>
	import {
		ressetpassword
	} from "../../api/api/index.js"
	export default {
		data() {
			return {
				inputvalue: "",
				loadModal: false,
			}
		},
		methods: {
			countInput: function(e) {
				this.inputvalue = e.detail.value
			},
			truebtn: function() {
				if (this.inputvalue == "") {
					this.loadModal = true;
					setTimeout(() => {
						this.loadModal = false;
					}, 1500)
				} else {
					let data = {
						password: this.inputvalue
					}
					ressetpassword(data).then(res => {
						let that=this
						uni.setStorageSync("flag", 1)
						uni.showModal({
							title: "重新登入账号",
							showCancel: false,
							success: function(res) {
								that.jumpLink({
									link: "/pages/index/index"
								})
							}
						})
					})
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.bigbox {
		position: absolute;
		background-color: #FFFFFF;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;

		.reset {
			text-align: center;
			font-family: MicrosoftYaHei-Bold;
			font-size: 40rpx;
			font-weight: 700;
			color: #000000;
			margin-top: 61rpx;
		}

		.passwordsbox {
			margin-left: 57rpx;
			margin-right: 47rpx;
			height: 86rpx;
			padding: 28rpx 0;
			box-sizing: border-box;
			border-bottom: 3rpx solid #999999;
			margin-top: 150rpx;
		}

		.truebtn {
			margin-left: 76rpx;
			margin-right: 54rpx;
			height: 103rpx;
			line-height: 103rpx;
			text-align: center;
			background-image: linear-gradient(-30deg,
				#e1312d 0%,
				#f8524f 99%),
				linear-gradient(#ffffff,
				#ffffff);
			background-blend-mode: normal,
				normal;
			box-shadow: 0rpx 6rpx 13rpx 2rpx rgba(228, 31, 31, 0.35);
			border-radius: 52rpx;
			font-size: 36rpx;
			color: #FFFFFF;
			font-family: MicrosoftYaHei;
			margin-top: 143rpx;
		}

		.popup {
			position: fixed;
			top: 0;
			right: 0;
			bottom: 104rpx;
			left: 0;
			margin: 246rpx auto;
			width: 485rpx;
			height: 294rpx;
			background-color: #FFFFFF;
			border-radius: 20rpx;
			// display: flex;
			align-items: center;
			font-family: MicrosoftYaHei;
			font-size: 30rpx;
			color: #000000;
			z-index: 9999;
			box-shadow: 0 0 0rpx 2000rpx rgba(0, 0, 0, 0.5);

			image {
				width: 84rpx;
				margin: 54rpx 200rpx;
				height: 84rpx;
			}

			.gray-text {
				text-align: center;
			}
		}
	}
</style>
